#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
inline ll read(){
    ll xx=0;short flag=1;char ch=getchar();
    while(ch<'0'||ch>'9'){
        if(ch=='-')flag=-1;
        ch=getchar();
    }
    while('0'<=ch&&ch<='9'){
        xx=(xx<<3)+(xx<<1)+ch-'0';
        ch=getchar();
    }
    return xx*flag;
}
int n;
multiset<int> s1,s2;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    n=read();
    for(int i=1;i<=n;i++)s1.insert(read());
    while(1){
        if(s2.size()&&(*s2.begin()<(*s1.begin()))){
            s2.erase(s2.begin());
            s2.insert(*s1.begin());
            s1.erase(s1.begin());
        }else{
            auto tmp=s1.upper_bound(*s1.begin());
            if(tmp!=s1.end()){
                s2.insert(*tmp);
                s1.erase(tmp);
                s1.erase(s1.begin());
            }
            else break;
        }
    }
    cout<<s1.size()+s2.size()<<endl;
    
    return 0;
}